package com.sysmenu.service;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.pojo.SysmenuPojo;
import com.sysmenu.dao.SysmenuDao;

public class SysmenuServiceImpl implements SysmenuService {

	private SysmenuDao sysMenuDao;
	public static Logger log = Logger.getLogger(SysmenuServiceImpl.class);

	/**
	 * 保存菜单
	 * 
	 * @param paraMap
	 * @return
	 */
	public boolean saveSysmenu(Map<String, Object> paraMap) {
		try {
			int result = sysMenuDao.addSysmenu(paraMap);
			if (result == 1)
				return true;
			return false;
		} catch (Exception e) {

			log.error(" saveSysmenu", e);
			return false;
		}
	}

	/**
	 * 菜单列表
	 * 
	 * @return
	 */
	public List<SysmenuPojo> searchMenuList(Map<String,Object> paraMap) {
		return sysMenuDao.searchMenuList(paraMap);
	}
	
	public boolean deleteByIdString(String idString)
	{
		return sysMenuDao.deleteByIdString(idString);
	}
   /**
    * 菜单总数
    * @return
    */
	public int searchMenuCount() {
		return sysMenuDao.searchMenuCount();
	}
	
	public SysmenuDao getSysMenuDao() {
		return sysMenuDao;
	}

	public void setSysMenuDao(SysmenuDao sysMenuDao) {
		this.sysMenuDao = sysMenuDao;
	}
}
